<template>
    <view>
        <view class="dis_f_l_c">
            <view style="position: relative">
                <u-avatar :src="headerData.avatar" size="70" mode="aspectFill" ></u-avatar>
            </view>
            <view class="m_l_10" style="width: 100%;">
                <view class="dis_f_l_c">
                    <view class="m_r_5 f_s_18">{{headerData.nickName}}</view>
                    <u-icon v-if="headerData.sex==1" name="woman" color="#D5656D" size="20" ></u-icon>
                    <u-icon v-if="headerData.sex==0" name="man" color="#65a0d5" size="20"></u-icon>
                </view>
                <view class="dis_f_l_c f_s_14 m_t_5">
                    <view > <text class="f_s_16 f_w_b">{{headerData.allOrder}}</text>次服务</view>
                </view>
            </view>
        </view>
    </view>
</template>
<script>
import {addCollectionUserApi} from "@/sheep/api";

export default {
    name: "index",
    props: {
        headerData: {
            type: Object,
            default: () => {
                return {}
            }
        },
        isFollow:{
            type: Boolean,
            default: false
        }
    },
    methods:{
        handleLike(type){
            let that = this
            //二次确认
            uni.showModal({
                title: '提示',
                content: type==1?'确定关注TA吗？':'确定取消关注TA吗？',
                success: (res) => {
                    addCollectionUserApi(this.userId).then(res=>{
                        uni.showToast({
                            title: type==1?'关注成功':'取消关注成功',
                            icon: 'success',
                            duration: 2000
                        })
                        if (res.code == 200) {
                            that.$emit('refresh')
                        }
                    })
                }
            });
        },
    }
}
</script>

<style scoped lang="scss">
.gz{
    position: absolute;
    bottom: 0;
    right: 0;
}
</style>
